<!-- Generic/Aero version Version -->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:BrokenHouse.Windows.Controls"
                    xmlns:diag="clr-namespace:System.Diagnostics;assembly=WindowsBase"
                    xmlns:system="clr-namespace:System;assembly=mscorlib"
    xmlns:chrome="clr-namespace:BrokenHouse.Windows.Controls.Themes.Aero">

    <Style x:Key="CommandLinkFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border>
                        <Rectangle Margin="2" Stroke="Black" StrokeThickness="1" StrokeDashArray="1 2" SnapsToDevicePixels="True" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="{x:Type local:CommandLink}">
        <Setter Property="FocusVisualStyle" Value="{StaticResource CommandLinkFocusVisual}"/>
        <Setter Property="Background" Value="#01000000"/>
        <Setter Property="BorderBrush" Value="#00000000"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Foreground" Value="#181c52"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:CommandLink}">
                    <chrome:CommandLinkChrome Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
                                              RenderDefaulted="{TemplateBinding IsFocused}" RenderMouseOver="{TemplateBinding IsMouseOver}"
                                              RenderPressed="{TemplateBinding IsPressed}" 
                                              RenderEnabled="{TemplateBinding IsEnabled}" 
                                              Foreground="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Foreground, Mode=TwoWay}"
                                              SnapsToDevicePixels="True"
                                              VerticalAlignment="Stretch">
                        
                        <Grid VerticalAlignment="Center" HorizontalAlignment="Left" Margin="{TemplateBinding Padding}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            
                            <ContentPresenter x:Name="PART_IconPresenter" Margin="2,4,2,4" 
                                              Content="{TemplateBinding Icon}"
                                              ContentTemplate="{TemplateBinding IconTemplate}"
                                              DockPanel.Dock="Left" VerticalAlignment="Center">
                                <ContentPresenter.Resources>
                                    <DataTemplate DataType="{x:Type BitmapSource}">
                                        <local:ActiveIcon Source="{Binding .}" Width="16" Height="16" SnapsToDevicePixels="True"/>
                                    </DataTemplate>
                                </ContentPresenter.Resources>
                            </ContentPresenter>
                            
                            <ContentPresenter Margin="4,0,0,0" 
                                              Content="{TemplateBinding Instruction}"
                                              ContentTemplate="{TemplateBinding InstructionTemplate}"
                                              Grid.Column="1" Grid.Row="0"
									          HorizontalAlignment="Left" VerticalAlignment="Center" RecognizesAccessKey="True">
                                <ContentPresenter.Resources>
                                    <DataTemplate DataType="{x:Type system:String}">
                                        <TextBlock FontSize="16" TextWrapping="Wrap" Text="{Binding .}"/>
                                    </DataTemplate>
                                </ContentPresenter.Resources>
                            </ContentPresenter>
                        
                            <ContentPresenter Margin="4,0,0,0"  Grid.Column="1" Grid.Row="1"
                                              Content="{TemplateBinding Content}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                              ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                              HorizontalAlignment="Left" VerticalAlignment="Center" RecognizesAccessKey="True">
                                <ContentPresenter.Resources>
                                    <DataTemplate DataType="{x:Type system:String}">
                                        <TextBlock TextWrapping="Wrap" Text="{Binding .}"/>
                                    </DataTemplate>
                                </ContentPresenter.Resources>
                            </ContentPresenter>
                        </Grid>
                    </chrome:CommandLinkChrome>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="#ADADAD"/>
                        </Trigger>
                        <Trigger Property="IconHasDropShadow" Value="true">
                            <Setter TargetName="PART_IconPresenter" Property="Effect">
                                <Setter.Value>
                                    <DropShadowEffect ShadowDepth="2" BlurRadius="5" Opacity="0.6"/>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
